package sopt.dev.network;

import com.mycila.xmltool.XMLDoc;

/**
 * Created by Dev on 13. 8. 12.
 */
public class CurrencyRateRequest extends NetworkRequest{

	private static final String preUrl = "http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=";
	private static final String postUrl = "&ToCurrency=";

	public CurrencyRateRequest(String fromCurrency, String toCurrency) {
		setUrl(preUrl + fromCurrency + postUrl + toCurrency);
	}

	@Override
	public Object getResult() {
		return Double.parseDouble(result.toString());
	}

	@Override
	protected void parsing() {
		result = XMLDoc.from(url, true).getCDATAorText();   
		
	}



}
